// 定义构造函数
// function Person() {
//   this.name = 'zhichao'
//   this.sex = 'nan'
// }

// Person.prototype.say = function (msg) {
//   console.log('说话：', msg)
// }

// let p1 = new Person()
// p1.say()

class PersonC {

  // 普通属性
  // name
  // sex
  constructor(name,sex){
    // 初始化已定义好类属性的值
      // 或者一次性初始化属性并且赋值,也可以完成复杂的属性赋值逻辑
      this.name = name
      this.sex = sex
  
    console.log('构造函数被调用:');
    
  }

  // 普通方法
  say(msg){
    console.log(`姓名：${this.name},性别：${this.sex} ,说：${msg}`);
  }
}


class BingRen  extends PersonC{

  bingfang
  constructor(bf,...arg){
    super(...arg)
    this.bingfang = bf
  }

  sayHi(status){
    console.log(`在 ${this.bingfang}`);
    this.say(status)
  }
}
let pc1 = new PersonC('杨院长','千年老妖')
pc1.say('喜欢放电哈基米')

let pc2 = new PersonC('cuimengjiao','girl')
pc2.say('天天向上')

console.log('---------------------------------');

let br1 = new BingRen('1号','zhichao','man')
br1.sayHi('正在康复中。。')

let br2 = new BingRen('抢救室','cuimengjiao','girl')
br2.sayHi('活蹦乱跳...')








